/*
 * CoutTask.java
 * 
 * last update: 15.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */

package engine;

class CoutTask extends DefaultInstruction{
	Expression target;

	CoutTask(NameSpace ns, int delayBefore, InstructionDescription desc,
			Expression target, DefaultInstruction next){
		super(ns, delayBefore, desc);
		this.target = target;
		add(next);
	}

	public void execute()
	throws InterpretTimeException, SimulationStoppedException
	{
		waitToRun();
		try{
			xConsole.trace(">>>" + target +" = " + target.evaluate());
		}catch(InterpretTimeException ex){
			xConsole.dumpStack(ex);
			throw new InterpretTimeException(desc + ": error:" + ex);
		}
	}

}

